import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import {
  FormItem,
  Form,
  Input,
  Row,
  Button,
  Message,
  Container,
  Header,
  Aside,
  Main,
  Tooltip,
  Menu,
  MenuItem,
  MenuItemGroup,
  Submenu,
  Divider,
  Dropdown,
  DropdownMenu,
  DropdownItem,
  Breadcrumb,
  BreadcrumbItem,
  Tag,
  Card,
  Select,
  Option
} from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import './style/icon.less'
import './plugins/element'
import './utils/dayjs'
// import axios from 'axios'

// Vue.prototype.$http = axios
// axios.defaults.baseURL = 'http://127.0.0.1:7002'

Vue.config.productionTip = false
Vue.use(Select)
Vue.use(Option)
Vue.use(Card)
Vue.use(Tag)
Vue.use(Breadcrumb)
Vue.use(BreadcrumbItem)
Vue.use(Form)
Vue.use(FormItem)
Vue.use(Input)
Vue.use(Row)
Vue.use(Button)
Vue.use(Container)
Vue.use(Header)
Vue.use(Aside)
Vue.use(Main)
Vue.use(Tooltip)
Vue.use(Menu)
Vue.use(MenuItem)
Vue.use(MenuItemGroup)
Vue.use(Submenu)
Vue.use(Divider)
Vue.use(Dropdown)
Vue.use(DropdownMenu)
Vue.use(DropdownItem)
Vue.prototype.$message = Message
import 'element-ui/lib/theme-chalk/index.css'

import axios from 'axios'
axios.defaults.baseURL = 'http://127.0.0.1:7001'
axios.interceptors.request.use(config => {
  // console.log(config)
  config.headers.Authorization =
    'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjIsImlhdCI6MTYwOTMyNDA2NiwiZXhwIjoxNjQwNDI4MDY2fQ.y4kkO8cNT4PcFCT9GLemWBN_AKWBJMP-TyDQiCV6h7g'
  // 在最后必须 return config
  return config
})
// 导入富文本编辑器
// import VueQuillEditor from 'vue-quill-editor'
// 导入富文本编辑器对应的样式
// import 'quill/dist/quill.core.css'
// import 'quill/dist/quill.snow.css'
// import 'quill/dist/quill.bubble.css'
//  将富文本编辑器,注册为全局可用组件
// Vue.use(VueQuillEditor)
Vue.filter('dateFormat', function(originVal) {
  const dt = new Date(originVal)
  const y = dt.getFullYear()
  const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  const d = (dt.getDate() + '').padStart(2, '0')
  const hh = (dt.getHours() + '').padStart(2, '0')
  const mm = (dt.getMinutes() + '').padStart(2, '0')
  const ss = (dt.getSeconds() + '').padStart(2, '0')
  return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
})
Vue.config.productionTip = false
Vue.prototype.$http = axios

new Vue({
  router,
  store,
  render: (h) => h(App)
}).$mount('#app')
